home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 076-100 / disk_085 / rawio / poster < prev    next >
Text File  |  1992-05-06  |  1KB  |  27 lines

  1. Article 5545 of comp.sys.amiga:
  2. Path: mcdsun!noao!hao!husc6!mit-eddie!genrad!decvax!decwrl!pyramid!oliveb!sun!pepper!cmcmanis
  3. From: cmcmanis%pepper@Sun.COM (Chuck McManis)
  4. Newsgroups: comp.sys.amiga
  5. Subject: Set your console to raw mode
  6. Keywords: cbreak() raw() cooked()
  7. Message-ID: <21174@sun.uucp>
  8. Date: 16 Jun 87 09:09:27 GMT
  9. Sender: news@sun.uucp
  10. Lines: 256
  11.  
  12. Many times I have wanted to set 'stdin' in my programs to what is often
  13. referred to as 'CBREAK' mode. Basically, that means that every time you
  14. call getchar() you get a character. Up until now there was no easy way
  15. to do that. The enclosed shar file contains three files, testraw.c
  16. raw.c and sendpacket.c. The interesting one is raw.c which contains the
  17. functions raw() and cooked(). These take a file pointer (FILE *) and
  18. convert it to raw mode or cooked mode respectively. The testraw.c file
  19. shows how it is done. Note that this will probably only work for Lattice
  20. users since it uses the Lattice ios1.h file to find the DOS FileHandle
  21. associated with a 'Level 2' file. Anyway, it was short so it is included
  22. here complete.
  23.  
  24. --Chuck McManis
  25. uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
  26. These opinions are my own and no one elses, but you knew that didn't you.
  27.